home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / fastlane.arc / TIMER.DOC < prev   
Text File  |  1985-10-20  |  3KB  |  56 lines

  1.                 High Resolution Timer Test Program
  2.                 ---- ---------- ----- ---- -------
  3.  
  4. The program TIMER.ASM is based on the article in the April 1984 issue
  5. of PC Tech Journal entitled "Life in the Fast Lane" by B. Smith and T.
  6. Puckett.  It has been modified slightly to make it easier to use.  The
  7. following are the major modifications to the code presented in the
  8. article:
  9.  
  10.    1) The calibration and code to be tested sections have been broken
  11.       out into separate subroutines.  This means that no modification of
  12.       this code is necessary to run timings.  Simply set up the two
  13.       subroutines as noted below, assemble them separately, and link
  14.       in this code.  The code to be tested should be placed in two
  15.       subroutines:  "CALIB", containing any code whose effect is to be
  16.       removed from the results (loop control, etc.), and "TEST", which
  17.       should contain the actual code to be tested.
  18.  
  19.    2) The number of clock ticks is printed out (albeit crudely), so
  20.       one does not have to use debug to run this. The routine prints
  21.       out the number of 0.84 microsecond clock ticks (in hex)
  22.  
  23. Also included are three test routines:  TESTIME.ASM, TESTIME2.ASM, and
  24. TESTIME3.ASM.  They can be used as examples of how to set up the "TEST"
  25. and "CALIB" routines.  TESTIME.ASM and TESTIME2.ASM are simply the test
  26. code published in the article as REGCNV04 and REGCNV05.  TESTIME3.ASM
  27. is a third subroutine that performs the same function as the first two,
  28. but is significantly faster (slightly more code, though).  This is
  29. the way I normally do the conversion to ascii hex.
  30.  
  31. To use these routines (using TESTIME as an example), do the following:
  32.  
  33.    A> masm timer;            (if timer.obj does not already exist)
  34.    A> masm testime;
  35.    A> link testime+timer;
  36.    A> run testime
  37.  
  38. The program will print out the number of 0.84 microsecond clock ticks
  39. in hex, so a good hex calculator is useful with this program.  With
  40. a little more effort, the output could be scaled to print out directly
  41. in microseconds.  As I am usually just interested in determining
  42. relative speeds of two different approaches, I have not done this.
  43. For the examples given, I obtained the following results:
  44.  
  45.        subroutine       # ticks
  46.        ----------       --------
  47.         TESTIME         0000007A    ( 102 ms )
  48.         TESTIME2        00000072    (  96 ms )
  49.         TESTIME3        00000045    (  58 ms )
  50.  
  51. For a full description of these routines, I will refer you to the
  52. original article.  It explains everything much better than I could.
  53. Enjoy.
  54.  
  55.                                                 Tim Fischer
  56.                                                 Lake Elmo, MN